package com.itheima.dao;

import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {
    @Insert("insert into tb_account(name,money) values(#{name},#{money} where id = #{id})")
    void add();
    @Delete("delete tb_account where id=#{id}")
    void delete(int id);
    @Update("update tb_account set name=#{name},money=#{money} where id =#{id}")
    void update(Account account);
    @Select("select * from tb_account")
    List<Account> queryAll();
    @Select("select * from tb_account where id = #{id}")
    Account findById(int id);


}
